abstract class Animal {
    // 抽象方法，要求子类实现自己的叫声
    public abstract void cry();
    // 抽象方法，要求子类实现自己的种类名称
    public abstract String getAnimalName();
}

class Dog extends Animal {
    public void cry() {
        System.out.println("汪汪汪！");
    }

    public String getAnimalName() {
        return "狗";
    }
}

class Cat extends Animal {
    public void cry() {
        System.out.println("喵喵喵！");
    }
    
    public String getAnimalName() {
        return "猫";
    }
}

class Simulator {
    public void playSound(Animal animal) {
        System.out.println(animal.getAnimalName() + "的叫声：");
        animal.cry();
    }
}

public class Application {
    public static void main(String[] args) {
        Simulator simulator = new Simulator();
        simulator.playSound(new Dog());
        simulator.playSound(new Cat());
    }
}